package com.isoftstone.merchant.dao.bind;

import com.isoftstone.common.Page;
import com.isoftstone.merchant.entity.bind.MBind;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface MBindMapper {

    int deleteByPrimaryKey(Long seqId);

    int addBind(MBind bind)throws Exception;

    int insertSelective(MBind record);

    MBind selectByPrimaryKey(Long seqId);

    int updateByPrimaryKeySelective(MBind record);

    int updateByPrimaryKey(MBind record);

    /**
     * 根据feeUserId查询
     * @param feeUserId
     * @return
     * @throws Exception
     */
    MBind queryBindByThreeParam(@Param("feeUserId") String feeUserId, @Param("corpId") String corpId, @Param("openAccount") String openAccount)throws Exception;

    /**
     * 根据feeUserId更新
     * @param bind
     * @throws Exception
     */
    void updateBindByFeeUserId(MBind bind)throws Exception;

    MBind getBindUserNumber(Page page) throws Exception;

    Integer getUserNumber(Page page)throws Exception;

    Integer getTodayUserNumber(Page page)throws Exception;

    //解约
    void cancelContract(@Param("feeUserId") String feeUserId, @Param("corpId") String corpId, @Param("openAccount") String openAccount)throws Exception;

    //续约
    void extentContract(@Param("feeUserId") String feeUserId,@Param("corpId") String corpId, @Param("openAccount") String openAccount)throws Exception;
    MBind queryMbindByThreeParam(@Param("feeUserId") String feeUserId, @Param("openAccount") String openAccount, @Param("corpId") String corpId) throws Exception;
}